{% extends 'base.html' %}
{% load static %}
{% block header %}

    <script src={% static '/js/user.js' %}> </script>
{% endblock %}
{% block content %}
    {% csrf_token %}
{#    <input type="hidden" name="csrfmiddlewaretoken" value="SSm6OhZlgtgLmmLi07RWmPYijzLpebaCh0pFbf57zYddklUSB4EBEks157EvG81b">#}
    <div class="Bott">
			<div class="wrapper clearfix" style="margin: 0 auto">
				<div class="zuo fl" style="margin-left: 100px; height: 502px;">
					<h3>
						<a href="/"><img src="/{{ user.img }}" width="100px" height="100px"></a>
						<p class="clearfix"><span class="fl" style="font-size: 15px;margin-left: -12px;">[{{ user.email }}]</span>
                            <span class="fr logout" style="font-size: 15px; "href="/user/logout/">[退出登录]</span>
                        </p>
					</h3>
					<div>
            <ul>
                <li><a href="/user/usercenter/">个人信息</a></li>
            </ul>
            <ul>
				<li><a href="/user/mypassword/">修改密码</a></li>
			</ul>
            <ul>
                <li><a href="/user/myorder/">我的订单</a></li>
            </ul>
            <ul>
                <li><a href="/user/address/">地址管理</a></li>
            </ul>
            <ul>
                <li><a href="/">回到首页</a></li>
            </ul>

					</div>
				</div>
				<div class="you fl" style="height: 502px;">

    <div class="tx clearfix">
						<div class="fl clearfix">
							<a href="/user/center/#" class="fl"><img src="/{{ user.img }}" width="100%" height="100%"></a>
							<p class="fl"><span>{{ user.name }}</span><a href="/user/usersession/">修改个人信息&gt;</a></p>
						</div>
						<div class="fr">绑定邮箱：{{ user.email }}</div>
					</div>
    <div class="bott">
						<div class="clearfix">
							<a href="http://127.0.0.1:8000/user/usercenter/#" class="fl"><img src="/static/待付款.png" width="20px" height="20px"></a>
							<p class="fl"><span>待支付的订单：<strong>{{ wsum }}</strong></span>
{#								<a href="http://127.0.0.1:8000/user/usercenter/#">查看待支付订单&gt;</a>#}
							</p>
						</div>
						<div class="clearfix">
							<a href="http://127.0.0.1:8000/user/usercenter/#" class="fl"><img src="/static/待收货.png" width="20px" height="20px"></a>
							<p class="fl"><span>待收货的订单：<strong>{{ ysum }}</strong></span>
{#								<a href="http://127.0.0.1:8000/user/usercenter/#">查看待收货订单&gt;</a>#}
							</p>
						</div>
					</div>

				</div>

            </div>
            </div>
{% endblock %}



{% block footer %}
    <script src="{% static  '/vendor/bootstrap/js/bootstrap.bundle.js' %}"></script>
    <script>
    $('.logout').click(function () {

        $.ajax({
            type:'post',
            url:'/user/logout/',
            data:'csrfmiddlewaretoken='+$('input[name="csrfmiddlewaretoken"]').val(),
            success:function(result){
                if (result.flag){
                    window.location='/user/login/'
                }

            }
        })
    })
    </script>
{% endblock %}

